public class Example {

    public static void main(String[] args) {
        String s1 = new String("hello");
        String s2 = new String("hello");
        System.out.println(s1 == s2);
        System.out.println(s1.equals(s2));

        String s3 = new String("hello");
        String s4 = "hello";
        System.out.println(s3 == s4);
        System.out.println(s3.equals(s4));

        String s5 = "hello";
        String s6 = "hello";
        System.out.println(s5 == s6);
        System.out.println(s5.equals(s6));
        String s7="hello";
        String s8="h";
        String s9="ello";
        String s10=s8+s9;
        System.out.println(s7==s10);
        System.out.println(s7.equals(s10));
    }

}
